package com.wowangz.cms.systemmanage.exportreport.service;

import java.util.HashMap;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.wowangz.cms.syscore.exception.ServiceException;
import com.wowangz.cms.syscore.service.BaseService;
import com.wowangz.cms.systemmanage.exportreport.entity.BuyRecord;
import com.wowangz.cms.systemmanage.exportreport.entity.CallRecord;
import com.wowangz.cms.systemmanage.exportreport.entity.PreferentialRecord;
import com.wowangz.cms.systemmanage.exportreport.entity.TapesRecord;
import com.wowangz.cms.systemmanage.exportreport.entity.TranslatorOnOff;
import com.wowangz.cms.systemmanage.exportreport.entity.TranslatorOnline;
import com.wowangz.cms.systemmanage.exportreport.entity.TranslatorOrder;
import com.wowangz.cms.systemmanage.exportreport.entity.TranslatorRecord;
import com.wowangz.cms.systemmanage.exportreport.entity.UnpaiedPackageRecord;


public class ExportReportService extends BaseService {

	private Logger logger = LoggerFactory.getLogger(ExportReportService.class);
	
	/**
	 * 
	 * @Title: findCallRecordCount 
	 * @Description: 用户叫单分页查询总条数
	 * @return long
	 * @author Green.Long
	 * @date 2016年8月14日 下午11:33:59
	 */
	public long findCallRecordCount(HashMap<String, Object> map) throws ServiceException {
		Long countNum = null;
		try {
			countNum = this.getSqlSession().selectOne("ExportReport.queryListCallRecordCount", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return countNum;
	}

	/**
	 * 
	 * @Title: findCallRecordList 
	 * @Description: 用户叫单查询记录集合
	 * @return List<CallRecord>
	 * @author Green.Long
	 * @date 2016年8月14日 下午11:33:49
	 */
	public List<CallRecord> findCallRecordList(HashMap<String, Object> map) throws ServiceException {
		List<CallRecord> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.queryListCallRecordPage", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	/**
	 * 
	 * @Title: listCallRecord 
	 * @Description: 查询全部叫单数据
	 * @return List<CallRecord>
	 * @author Green.Long
	 * @date 2016年8月14日 下午11:34:30
	 */
	public List<CallRecord> listCallRecord(HashMap<String, Object> map) throws ServiceException {
		List<CallRecord> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.listCallRecord", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	
	/**
	 * 
	 * @Title: findBuyRecordCount 
	 * @Description: 购买套餐分页查询总条数
	 * @return long
	 * @author Green.Long
	 * @date 2016年8月15日 下午2:43:25
	 */
	public long findBuyRecordCount(HashMap<String, Object> map) throws ServiceException {
		Long countNum = null;
		try {
			countNum = this.getSqlSession().selectOne("ExportReport.queryListBuyRecordCount", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return countNum;
	}

	/**
	 * 
	 * @Title: findBuyRecordList 
	 * @Description: 购买套餐分页查询
	 * @return List<BuyRecord>
	 * @author Green.Long
	 * @date 2016年8月15日 下午2:44:39
	 */
	public List<BuyRecord> findBuyRecordList(HashMap<String, Object> map) throws ServiceException {
		List<BuyRecord> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.queryListBuyRecordPage", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	
	/**
	 * 
	 * @Title: listBuyRecord 
	 * @Description: 查询全部购买套餐记录
	 * @return List<BuyRecord>
	 * @author Green.Long
	 * @date 2016年8月15日 下午2:42:04
	 */
	public List<BuyRecord> listBuyRecord(HashMap<String, Object> map) throws ServiceException {
		List<BuyRecord> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.listBuyRecord", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	
	/**
	 * 
	 * @Title: findTranslatorRecordCount 
	 * @Description: 译员清单分页查询总条数
	 * @return long
	 * @author Green.Long
	 * @date 2016年8月15日 下午3:29:16
	 */
	public long findTranslatorRecordCount(HashMap<String, Object> map) throws ServiceException {
		Long countNum = null;
		try {
			countNum = this.getSqlSession().selectOne("ExportReport.queryListTranslatorRecordCount", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return countNum;
	}

	/**
	 * 
	 * @Title: findTranslatorRecordList 
	 * @Description: 译员清单分页查询
	 * @return List<TranslatorRecord>
	 * @author Green.Long
	 * @date 2016年8月15日 下午3:30:09
	 */
	public List<TranslatorRecord> findTranslatorRecordList(HashMap<String, Object> map) throws ServiceException {
		List<TranslatorRecord> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.queryListTranslatorRecordPage", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	
	/**
	 * 
	 * @Title: listTranslatorRecord 
	 * @Description: 查询全部译员清单
	 * @return List<TranslatorRecord>
	 * @author Green.Long
	 * @date 2016年8月15日 下午3:31:53
	 */
	public List<TranslatorRecord> listTranslatorRecord(HashMap<String, Object> map) throws ServiceException {
		List<TranslatorRecord> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.listTranslatorRecord", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	
	/**
	 * 
	 * @Title: findUnpaiedPackageRecordCount 
	 * @Description: 下单未购买分页查询总条数
	 * @return long
	 * @author Green.Long
	 * @date 2016年8月15日 下午3:55:18
	 */
	public long findUnpaiedPackageRecordCount(HashMap<String, Object> map) throws ServiceException {
		Long countNum = null;
		try {
			countNum = this.getSqlSession().selectOne("ExportReport.queryListUnpaiedPackageRecordCount", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return countNum;
	}

	/**
	 * 
	 * @Title: findUnpaiedPackageRecordList 
	 * @Description: 下单未购买分页查询
	 * @return List<UnpaiedPackageRecord>
	 * @author Green.Long
	 * @date 2016年8月15日 下午3:55:33
	 */
	public List<UnpaiedPackageRecord> findUnpaiedPackageRecordList(HashMap<String, Object> map) throws ServiceException {
		List<UnpaiedPackageRecord> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.queryListUnpaiedPackageRecordPage", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	
	/**
	 * 
	 * @Title: listUnpaiedPackageRecord 
	 * @Description: 查询全部下单未购买
	 * @return List<UnpaiedPackageRecord>
	 * @author Green.Long
	 * @date 2016年8月15日 下午3:55:46
	 */
	public List<UnpaiedPackageRecord> listUnpaiedPackageRecord(HashMap<String, Object> map) throws ServiceException {
		List<UnpaiedPackageRecord> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.listUnpaiedPackageRecord", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	
	/**
	 * 
	 * @Title: findPreferentialRecordCount 
	 * @Description: 优惠码使用情况查询总条数
	 * @return long
	 * @author Green.Long
	 * @date 2016年8月15日 下午4:24:06
	 */
	public long findPreferentialRecordCount(HashMap<String, Object> map) throws ServiceException {
		Long countNum = null;
		try {
			countNum = this.getSqlSession().selectOne("ExportReport.queryListPreferentialRecordCount", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return countNum;
	}

	/**
	 * 
	 * @Title: findPreferentialRecordList 
	 * @Description: 优惠码使用情况 分页查询
	 * @return List<PreferentialRecord>
	 * @author Green.Long
	 * @date 2016年8月15日 下午4:23:51
	 */
	public List<PreferentialRecord> findPreferentialRecordList(HashMap<String, Object> map) throws ServiceException {
		List<PreferentialRecord> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.queryListPreferentialRecordPage", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	
	/**
	 * 
	 * @Title: listPreferentialRecord 
	 * @Description: 查询全部优惠码使用情况 
	 * @return List<PreferentialRecord>
	 * @author Green.Long
	 * @date 2016年8月15日 下午4:23:36
	 */
	public List<PreferentialRecord> listPreferentialRecord(HashMap<String, Object> map) throws ServiceException {
		List<PreferentialRecord> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.listPreferentialRecord", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	
	/**
	 * 录音文件管理
	 * @param map
	 * @return
	 * @throws ServiceException
	 */
	public List<TapesRecord> listTapesRecord(HashMap<String, Object> map) throws ServiceException {
		List<TapesRecord> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.listTapesRecordSqlPage", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	/**
	 * 录音文件导出
	 * @param map
	 * @return
	 * @throws ServiceException
	 */
	public List<TapesRecord> exportTapesRecord(HashMap<String, Object> map) throws ServiceException {
		List<TapesRecord> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.listTapesRecordSqlEpt", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	/**
	 * 录音文件的数量
	 * @param map
	 * @return
	 * @throws ServiceException
	 */
	public long listTapesRecordCount(HashMap<String, Object> map) throws ServiceException {
		Long countNum = null;
		try {
			countNum = this.getSqlSession().selectOne("ExportReport.listTapesRecordSqlCount", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return countNum;
	}
	
	/**
	 * 译员在线时长列表
	 * @param map
	 * @return
	 * @throws ServiceException
	 */
	public List<TranslatorOnline> listTranslatorOnline(HashMap<String, Object> map) throws ServiceException {
		List<TranslatorOnline> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.listTranslatorOnlineTimePage", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	/**
	 * 译员在线时长数据总数
	 * @param map
	 * @return
	 * @throws ServiceException
	 */
	public long listTranslatorOnlineCount(HashMap<String, Object> map) throws ServiceException {
		Long count = null;
		try {
			count = this.getSqlSession().selectOne("ExportReport.listTranslatorOnlineTimeCount", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return count;
	}
	
	public List<TranslatorOnline> listTranslatorOnlineTimeEpt(HashMap<String, Object> map) throws ServiceException {
		List<TranslatorOnline> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.listTranslatorOnlineTimeEpt", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	
	/**
	 * 派单过程数据
	 * @param map
	 * @return
	 * @throws ServiceException
	 */
	public List<TranslatorOrder> listTranslatorOrder(HashMap<String, Object> map) throws ServiceException {
		List<TranslatorOrder> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.listTranslatorOrderPage", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	/**
	 * 派单过程总数
	 * @param map
	 * @return
	 * @throws ServiceException
	 */
	public long listTranslatorOrderCount(HashMap<String, Object> map) throws ServiceException {
		Long count = null;
		try {
			count = this.getSqlSession().selectOne("ExportReport.listTranslatorOrderCount", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return count;
	}
	
	public List<TranslatorOrder> listTranslatorOrderEpt(HashMap<String, Object> map) throws ServiceException {
		List<TranslatorOrder> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.listTranslatorOrderEpt", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	/**
	 * 译员上下线时间点
	 * @param map
	 * @return
	 * @throws ServiceException
	 */
	public List<TranslatorOnOff> listTranslatorOnOff(HashMap<String, Object> map) throws ServiceException {
		List<TranslatorOnOff> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.listTranslatorOnOffPage", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
	/**
	 * 译员上下线时间点总数
	 * @param map
	 * @return
	 * @throws ServiceException
	 */
	public long listTranslatorOnOffCount(HashMap<String, Object> map) throws ServiceException {
		Long count = null;
		try {
			count = this.getSqlSession().selectOne("ExportReport.listTranslatorOnOffCount", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return count;
	}
	
	public List<TranslatorOnOff> listTranslatorOnOffEpt(HashMap<String, Object> map) throws ServiceException {
		List<TranslatorOnOff> list = null;
		try {
			list = this.getSqlSession().selectList("ExportReport.listTranslatorOnOffEpt", map);
		} catch (Exception e) {
			e.printStackTrace();
			throw new ServiceException(e.getMessage());
		}
		return list;
	}
	
}
